/**
 *@module commons
 *@name GlobalCommons
 *@desc 全局公用函数
 *@author LiHongKun
 *@date 2018-10-10 17:05:59
 */
initPassword = function (record) {
    util.passwordConfirm(function () {
        util.post('publicUserManagementRoutes', {user_id: record.user_id,mobile: record.mobile, action_type: 'personResetPwd'}).then(function (response) {
            let result = Ext.decode(response.responseText);
            if (result.success) {
                Ext.toast(`密码初始成功`);
            } else {
                Ext.toast(`密码初始失败，${result.message}`);
            }
        }, function (response) {
            console.log(Ext.decode(response.responseText));
        });
    })
};
PeopleUpd=function(record){
    let btnCancel = Ext.create('Ext.button.Button', {
        cls: 'btnCancel',
        text: `取消`,
        scale: 'medium',
        width:140,
        height:42,
        margin:'0 0 10 200',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this

    });
    let btnSubmit = Ext.create('Ext.button.Button', {
        cls:'btnSubmit',
        border:false,
        text: `保存`,
        margin: '0 0 10 30',
        width:140,
        height:42,
        scale: 'medium',
        handler: function (btn) {
                let user_name=Ext.getCmp('user_name').getValue();
                let user_id=Ext.getCmp('user_id').getValue();
                let group_id=Ext.getCmp('group_id').getValue();
                let enable_char=Ext.getCmp('enable_char').getValue();
            if(user_name===''){
                Ext.toast('请将信息填写完整');
            }else{
                util.post('/publicUserManagementRoutes', {
                    action_type:'personUpdate',
                    user_name:user_name,
                    user_id:user_id,
                    group_id:group_id,
                    enable_char:enable_char,
                }).then(function (response) {
                    let obj= Ext.decode(response.responseText);
                    if(obj.success){
                        Ext.toast('保存成功');
                        let me = Ext.getCmp('PeopleManagementShowPage');
                        me.store.reload();
                        btn.up('window').close();
                    }else{
                        Ext.toast(`<div style="font-size:28px;">保存失败,${obj.message}</div>`);
                    }
                });
            }
        },
        scope: this
    });
    let formPanel = Ext.create('js.inner.PeopleMergerAAddPage',record);

    let win = util.window(formPanel, {title:'修改人员列表' ,width:'40%',height:'35%', buttons: ['->', btnCancel, btnSubmit, '->']});
    win.show();

};
upd=function (record) {
    let btnCancel = Ext.create('Ext.button.Button', {
        cls: 'btnCancel',
        text: `取消`,
        scale: 'medium',
        width:140,
        height:42,
        margin:'0 0 10 200',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this

    });
    let btnSubmit = Ext.create('Ext.button.Button', {
        cls:'btnSubmit',
        border:false,
        text: `保存`,
        margin: '0 0 10 30',
        width:140,
        height:42,
        scale: 'medium',
        handler: function (btn) {
            let unit_type=Ext.getCmp('unit_type').getValue();
            let check_date=Ext.getCmp('check_date').getValue();
            let check_details=Ext.getCmp('check_details').getValue();
            let user_ids=Ext.getCmp('userIdsObject_person').getValue();
            if(check_date===''||unit_type===null||user_ids===''||check_details===''){
                Ext.toast('请将信息填写完整');
            }else {
                util.post('/qualityCheckRoutes', {
                    action_type: 'qualityCheckUpdate',
                    rectification_date: Ext.getCmp('rectification_date').getValue(),
                    check_id: record.check_id,
                    unit_type: Ext.getCmp('unit_type').getValue(),
                    check_result: Ext.getCmp('check_result').getValue().check_result ? Ext.getCmp('check_result').getValue() : Ext.getCmp('check_result').value,
                    user_ids: Ext.getCmp('userIdsObject_person').getValue(),
                    check_details: Ext.getCmp('check_details').getValue(),
                    check_date: Ext.getCmp('check_date').getValue(),
                    check_type: record.check_type,
                    rectification_notice: Ext.getCmp('rectification_notice').getValue(),
                    rectification_reply: Ext.getCmp('rectification_reply').getValue(),
                    remarks: Ext.getCmp('remarks').getValue(),
                }).then(function (response) {
                    let obj = Ext.decode(response.responseText);
                    if (obj.success) {
                        Ext.toast('保存成功');
                        let me = Ext.getCmp('RandomInspectionOfQualityAssuranceSystemPage');
                        me.store.reload();
                        let meA = Ext.getCmp('RandomInspectionOfQualityBehaviorPage');
                        meA.store.reload();
                        btn.up('window').close();
                    } else {
                        Ext.toast(`<div style="font-size:28px;">保存失败,${obj.message}</div>`);
                    }
                });
            }
        },
        scope: this
    });
    let formPanel = Ext.create('js.ranInsOfProQui.ranInsOfProQuiAddPage',record);
    let win = util.window(formPanel, {title:'修改' ,width:'58%',height:'90%', buttons: ['->', btnCancel, btnSubmit, '->']});
    btnSubmit.on('click', formPanel.submit, formPanel);
    win.show();
    formPanel.on('actioncomplete', () => {
        this.getStore().reload();
        win.close();
    });
};
updA=function (record) {
    let btnCancel = Ext.create('Ext.button.Button', {
        cls: 'btnCancel',
        text: `取消`,
        scale: 'medium',
        width:140,
        height:42,
        margin:'0 0 10 200',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this

    });
    let btnSubmit = Ext.create('Ext.button.Button', {
        cls:'btnSubmit',
        border:false,
        text: `保存`,
        margin: '0 0 10 30',
        width:140,
        height:42,
        scale: 'medium',
        handler: function (btn) {
            let userIds=Ext.getCmp('userIdsObject_person').getValue();
            let check_details=Ext.getCmp('check_details').getValue();
            let check_date=Ext.getCmp('check_date').getValue();
            if(check_date===''||userIds===''||check_details===''){
                Ext.toast('请将信息填写完整');
            }else {
                util.post('/qualityCheckRoutes', {
                    action_type: 'qualityCheckUpdate',
                    check_id: Ext.getCmp('check_id').getValue(),
                    check_result: Ext.getCmp('check_result').getValue().check_result ? Ext.getCmp('check_result').getValue() : Ext.getCmp('check_result').value,
                    user_ids: Ext.getCmp('userIdsObject_person').getValue(),
                    check_details: Ext.getCmp('check_details').getValue(),
                    check_date: Ext.getCmp('check_date').getValue(),
                    check_type: Ext.getCmp('check_type').getValue(),
                    rectification_notice: Ext.getCmp('rectification_notice').getValue(),
                    rectification_reply: Ext.getCmp('rectification_reply').getValue(),
                    remarks: Ext.getCmp('remarks').getValue(),
                }).then(function (response) {
                    let obj = Ext.decode(response.responseText);
                    if (obj.success) {
                        Ext.toast('保存成功');
                        let me = Ext.getCmp('RandomInspectionOfQualityAssuranceSystemPage');
                        me.store.reload();
                        let meA = Ext.getCmp('RandomInspectionOfQualityBehaviorPage');
                        meA.store.reload();
                        btn.up('window').close();
                    } else {
                        Ext.toast(`<div style="font-size:28px;">保存失败,${obj.message}</div>`);
                    }
                });
            }
        },
        scope: this
    });
    let formPanel = Ext.create('js.ranInsOfProQui.ranInsOfProQuiAAddPage',record);
    let win = util.window(formPanel, {title:'修改' ,width:'58%',height:'83%', buttons: ['->', btnCancel, btnSubmit, '->']});
    btnSubmit.on('click', formPanel.submit, formPanel);
    win.show();
    formPanel.on('actioncomplete', () => {
        this.getStore().reload();
        win.close();
    });
};
xiangqing = function (record) {
    let formPanel = Ext.create('js.ranInsOfProQui.ranInsOfProQuishowPage',record);
    let win = util.window(formPanel, {title:'详情' ,width:'40%',height:'65%'});
    win.show();
};
del=function (record){
    let check_id =record.check_id;
    let region_name ='';
    let delTip = Ext.create('js.windows.DelTip',{name:region_name});
    let btnSubmit = Ext.create('Ext.button.Button', {
        text: '删除',
        cls:'btnSubmit',
        width:100,
        height:40,
        scale: 'medium',
        margin:'0 20 40 0',
        scale: 'medium',
        handler: function (btn) {
            Ext.create('Ext.window.Window', {
                title: '关键操作密码验证',
                height: '250', width: '500',
                border: false, modal: true, constrainHeader: true, buttonAlign: 'center',
                items: [{
                    padding: '30 30 20 150', html: '<span style="font-size:18px;">请输当前登录用户的密码:</span>', border: false ,
                }, {
                    xtype: 'textfield', id: 'authentication', inputType: 'password', padding: '0 30 0 130', autoComplete: false,width:250,
                }],
                buttons: [{
                    text: '确定',
                    cls:'btnSubmit',
                    scale: 'medium',
                    width:'100',
                    height:40,
                    margin:'0 20 40 0',
                    handler: function () {
                        let value = Ext.getCmp('authentication').getValue(), window = this.up('window');
                        if (value) {
                            js.Util.post('authentication', {password: value})
                                .then(function (response, opts) {
                                    let obj = Ext.decode(response.responseText);
                                    if (obj.success === true) {
                                        window.close();
                                        util.post('qualityCheckRoutes', {
                                            action_type: 'qualityCheckDel',
                                            check_id: check_id
                                        }).then(function (response) {
                                            let obj = Ext.decode(response.responseText);
                                            if (obj.success) {
                                                let me = Ext.getCmp('RandomInspectionOfQualityAssuranceSystemPage');
                                                me.store.reload();
                                                let meA = Ext.getCmp('RandomInspectionOfQualityBehaviorPage');
                                                meA.store.reload();
                                                Ext.toast('删除成功');
                                                btn.up('window').close();
                                                //  Ext.getCmp('PersonListPage').getStore().reload();
                                            } else {
                                                Ext.toast(obj.message);
                                            }
                                        })
                                    }
                                    else {
                                        Ext.toast(obj.message);
                                    }
                                })
                        }
                    }
                }, {
                    text: '取消',
                    cls: 'btnCancel',
                    width:'100',
                    height:40,
                    scale: 'medium',
                    border:false,
                    handler: function () {
                        this.up('window').close();
                    }
                }]
            }).show();
        }
    });
    let btnCancel = Ext.create('Ext.button.Button', {
        border:false,
        text: `<span style="color: #fff;" >取消</span>`,
        cls: 'btnCancel',
        width:100,
        height:40,
        style:{
            color:'#ececec'
        },
        margin: '0 90 45 30',
        scale: 'medium',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this
    });
    let win = util.window(delTip, {title: '删除',border:'#fff',width:'450',height:'250',cls:'windowsBorder', buttons: [ btnSubmit, btnCancel]});
    win.show();
}
/*退出*/
vim=function(){
    let vim={
        xtype:'panel',
        bodyPadding: '80 0 0 120',
        defaultType: 'textfield',
        html:'<span style="font-size: 26px;font-weight: normal;letter-spacing: 1px;color: #2672d9;">您确定退出当前账号吗？</span>',
        dockedItems: [{
            dock: 'bottom',
            xtype: 'toolbar',
            ui: 'fuck',
            height:100,
            items: [{
                xtype: 'button',
                cls:'tuichu',
                text: `<span style="color:#fff">取消</span>`,
                margin: '0 0 0 100',
                scale: 'medium',
                handler: function (btn) {
                    btn.up('window').close();
                },
            }, {
                xtype: 'button',
                // scale: 'user',
                arrow: true,
                cls: 'tuichuA',
                text: `<span style="color:#fff">确定</span>`,
                scale: 'medium',
                margin: '0 125 0 30',
                scope: this,
                handler: function(){
                    let success = function () {
                            window.location.reload();
                        },
                        fail = function () {
                            console.log('fail');
                        };
                    util.get('signOut').then(success, fail);

                }
            }]
        }]
    }
    let winS = util.window(vim, {title: '退出登录' ,height: '290', width: '500'});
    winS.show();
};
//修改密码
modifiPwd=function(){
    let formPanel = Ext.create('Ext.form.Panel', {
        url: 'publicUserManagementRoutes',
        waitMsgTarget: true,
        bodyPadding: '20 30 0 30',
        width: 200,
        defaultType: 'textfield',
        fieldDefaults: {
            inputType: 'password',
            labelWidth:110,
            margin:'30',
            allowBlank: false
        },
        items: [
            {
                fieldLabel: '请输入旧密码',
                emptyText: '请输入旧密码',
                name: 'oldPassword',
                height:30,
                margin:'0 0 20 0',
                width:430
            },{
                fieldLabel: '请输入新密码',
                emptyText: '请输入密码',
                name: 'newPassword',
                minLength: 6,
                height:30,
                margin:'0 0 20 0',
                width:430,
                maxLength: 16
            },{
                fieldLabel: '请再次输入密码',
                name: 'confirmPassword',
                emptyText: '请再次输入密码',
                minLength: 6,
                maxLength: 16,
                width:430,
                height:30,
                margin:'0 0 20 0',
                submitValue: true
            }],
        dockedItems: [{
            dock: 'bottom',
            xtype: 'toolbar',
            ui: 'fuck',
            height:90,
            items: ['->', {
                xtype: 'button',
                cls: 'tuichuA',
                text: `<span style="color:#fff">确定</span>`,
                height:40,
                width:100,
                scale: 'medium',
                margin: '10 0 10 0 ',
                handler: function(btn){
                    let resetPwdForm = btn.up('form');
                    let window = resetPwdForm.up('window');
                    let form = resetPwdForm.getForm();
                    let params = form.getValues();
                    if (form.isValid()) {
                        if (params.newPassword === params.confirmPassword) {
                            form.submit({
                                params: {action_type: 'personUpdatePwd'},
                                waitMsg: '正在修改密码，请稍后...',
                                success: function () {
                                    Ext.toast(`密码修改成功`);
                                    window.close();
                                },
                                failure: function (form, action) {
                                    Ext.toast(`密码修改失败，${action.result.message}`);
                                }
                            });
                        } else {
                            Ext.toast('两次输入的新密码不匹配');
                        }
                    }
                }
            }, {
                xtype: 'button',
                cls: 'tuichuA',
                height:40,
                width:100,
                text: `<span style="color:#fff">取消</span>`,
                margin: '0 120 0 40',
                scale: 'medium',
                handler: function (btn) {
                    btn.up('window').close();
                },
            },]
        }]
    });
    let win = util.window(formPanel, {title: '修改密码' ,height: '300', width: '500'});
    win.show();


};
/*返回主页*/
backMyPage = function(){
    let treelist = Ext.getCmp('treelist');
    treelist.setExpanderFirst(false);
    treelist.setUi('nav');
    treelist.setHighlightPath(true);
    let treeStore = treelist.getStore();
    treelist.setSelection(treeStore.getRoot().firstChild);
};
/*分页*/
Page =function(_ref) {
    var pageSize = _ref.pageSize,
        pageTotal = _ref.pageTotal,
        curPage = _ref.curPage,
        id = _ref.id,
        getPage = _ref.getPage,
        showPageTotalFlag = _ref.showPageTotalFlag,
        showSkipInputFlag = _ref.showSkipInputFlag,
        pageAmount = _ref.pageAmount,
        dataTotal = _ref.dataTotal;
    if(!pageSize){
        pageSize = 0
    }
    if(!pageSize){
        pageSize = 0
    }
    if(!pageTotal){
        pageTotal = 0
    }
    if(!pageAmount){
        pageAmount = 0
    }
    if(!dataTotal){
        dataTotal = 0
    }
    this.pageSize = pageSize || 5; //分页个数
    this.pageTotal = pageTotal; //总共多少页
    this.pageAmount = pageAmount; //每页多少条
    this.dataTotal = dataTotal; //总共多少数据
    this.curPage = curPage || 1; //初始页码
    this.ul = document.createElement('ul');
    this.id = id;
    this.getPage = getPage;
    this.showPageTotalFlag = showPageTotalFlag || false; //是否显示数据统计
    this.showSkipInputFlag = showSkipInputFlag || false; //是否支持跳转
    if(dataTotal >=0 &&pageTotal>0){
        this.init();
    }else{
        console.error("总页数或者总数据参数不对")
    }
};

// 给实例对象添加公共属性和方法
Page.prototype = {
    init: function init() {
        var pagination = document.getElementById(this.id);
        pagination.innerHTML = '';
        this.ul.innerHTML = '';
        pagination.appendChild(this.ul);
        var that = this;
        //是否显示总页数,每页个数,数据
        if (that.showPageTotalFlag) {
            that.showPageTotal();
        }
        //首页
        that.firstPage();
        //上一页
        that.lastPage();
        //分页
        that.getPages().forEach(function (item) {
            var li = document.createElement('li');
            if (item == that.curPage) {
                li.className = 'active';
            } else {
                li.onclick = function () {
                    that.curPage = parseInt(this.innerHTML);
                    that.init();
                    that.getPage(that.curPage);
                };
            }
            li.innerHTML = item;
            that.ul.appendChild(li);
        });
        //下一页
        that.nextPage();
        //尾页
        that.finalPage();

        //是否支持跳转
        if (that.showSkipInputFlag) {
            that.showSkipInput();
        }

    },
    //首页
    firstPage: function firstPage() {
        var that = this;
        var li = document.createElement('li');
        li.innerHTML = '<< 首页';
        this.ul.appendChild(li);
        li.onclick = function () {
            var val = parseInt(1);
            that.curPage = val;
            that.getPage(that.curPage);
            that.init();
        };
        li.className = 'shouye';
    },
    //上一页
    lastPage: function lastPage() {
        var that = this;
        var li = document.createElement('li');
        li.innerHTML = '<';
        if (parseInt(that.curPage) > 1) {
            li.onclick = function () {
                that.curPage = parseInt(that.curPage) - 1;
                that.init();
                that.getPage(that.curPage);
            };
        } else {
            li.className = 'disabled';
        }
        this.ul.appendChild(li);
    },
    //分页
    getPages: function getPages() {
        var pag = [];
        if (this.curPage <= this.pageTotal) {
            if (this.curPage < this.pageSize) {
                //当前页数小于显示条数
                var i = Math.min(this.pageSize, this.pageTotal);
                while (i) {
                    pag.unshift(i--);
                }
            } else {
                //当前页数大于显示条数
                var middle = this.curPage - Math.floor(this.pageSize / 2),
                    //从哪里开始
                    i = this.pageSize;
                if (middle > this.pageTotal - this.pageSize) {
                    middle = this.pageTotal - this.pageSize + 1;
                }
                while (i--) {
                    pag.push(middle++);
                }
            }
        } else {
            console.error('当前页数不能大于总页数');
        }
        if (!this.pageSize) {
            console.error('显示页数不能为空或者0');
        }
        return pag;
    },
    //下一页
    nextPage: function nextPage() {
        var that = this;
        var li = document.createElement('li');
        li.innerHTML = '>';
        if (parseInt(that.curPage) < parseInt(that.pageTotal)) {
            li.onclick = function () {
                that.curPage = parseInt(that.curPage) + 1;
                that.init();
                that.getPage(that.curPage);
            };
        } else {
            li.className = 'disabled';
        }
        this.ul.appendChild(li);
    },
    //尾页
    finalPage: function finalPage() {
        var that = this;
        var li = document.createElement('li');
        li.innerHTML = '尾页 >>';
        this.ul.appendChild(li);
        li.onclick = function () {
            var yyfinalPage = that.pageTotal;
            var val = parseInt(yyfinalPage);
            that.curPage = val;
            that.getPage(that.curPage);
            that.init();
        };
        li.className = 'weiye';
    },
    //是否支持跳转
    showSkipInput: function showSkipInput() {
        var that = this;
        var li = document.createElement('li');
        li.className = 'totalPage';
        var span1 = document.createElement('span');
        span1.innerHTML = '跳转到';
        li.appendChild(span1);
        var input = document.createElement('input');
        input.setAttribute("type","text");
        input.onkeydown = function (e) {
            var oEvent = e || event;
            if (oEvent.keyCode == '13') {
                var val = parseInt(oEvent.target.value);
                if (typeof val === 'number' && val <= that.pageTotal && val>0) {
                    that.curPage = val;
                    that.getPage(that.curPage);
                }else{
                    Ext.toast('请输入正确的页数!');
                }
                that.init();
            }
        };
        li.appendChild(input);
        var span2 = document.createElement('span');
        span2.innerHTML = '页';
        li.appendChild(span2);
        this.ul.appendChild(li);
    },
    //是否显示总页数,每页个数,数据
    showPageTotal: function showPageTotal() {
        var that = this;
        var li = document.createElement('li');
        li.innerHTML = '共' + that.pageTotal + '页';
        li.className = 'totalPage';
        this.ul.appendChild(li);

    }

};

//地基验槽
lc=function(
    engineering_id
    ,status
    ,engineering_no
    ,engineering_name
    ,foundation_test_tanks
    ,material_check_a
    ,foundation_test
    ,important_part_acceptance
    ,first_conversion_reinforcement
    ,material_check_b
    ,standard_reinforcement
    ,top_reinforcement
    ,quality_sampling
    ,concrete_structure
    ,material_check_c
    ,main_structure
    ,other_projects
    ,completion_initial_inspection
    ,completion_acceptance
    ,structural_solid_concrete_strength
    ,reinforcement_data
    ,masonry_mortar_strength
    ,planting_anchor
    ,foundation_inspection
    ,foundation_based_division
    ,main_division



){
    let newPanel;
    let newPanelA;
    let params;
    switch (status) {
        case 1:
            //地基验槽
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                //地基验槽状态
                Zstsatus:foundation_test_tanks,
                titleName:'地基验槽',
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);

            /*  util.post('designStaffRouters', {
                  action_type: 'designStaffProductQuery',
                  product_id: product_id,
              }).then(function (response) {
                  let obj = Ext.decode(response.responseText);
              });*/
            break;
        case 2:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'建筑材料/构配件抽查',
                //总状态
                Zstsatus:material_check_a,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
        case 3:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'地基检验',
                //总状态
                Zstsatus:foundation_test,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
        case 4:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                status:status,
                titleName:'重要分部验收',
                //地基验槽(所属重要分部验收
                foundation_inspection:foundation_inspection,
                //地基基础分部
                foundation_based_division:foundation_based_division,
                //主体分部
                main_division:main_division,
                PageName:'js.foundation.FoundationABShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowZybfysBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationAPageMain',params);
            break;
        case 7:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'首层或转换层验筋',
                //总状态
                Zstsatus:first_conversion_reinforcement,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
        case 8:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'建筑材料/构配件抽查',
                //总状态
                Zstsatus:material_check_b,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
        case 9:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'标准层钢筋',
                //总状态
                Zstsatus:standard_reinforcement,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
        case 10:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'顶层钢筋',
                //总状态
                Zstsatus:top_reinforcement,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
        case 11:
            //查询其他内容
            util.post('progressRoutes', {
                action_type: 'progressOtherQuery',
                engineering_id:engineering_id,
            }).then(function (response) {
                let obj = Ext.decode(response.responseText);
                let floor_thickness=obj.data.floor_thickness;
                let indoor_space_size=obj.data.indoor_space_size;
                params={
                    floor_thickness:floor_thickness,
                    indoor_space_size:indoor_space_size,
                    engineering_id:engineering_id,
                    engineering_no:engineering_no,
                    engineering_name:engineering_name,
                    titleName:'工程质量抽测',
                    //结构实体混凝土强度
                    structural_solid_concrete_strength:structural_solid_concrete_strength,
                    //钢筋位置、数量、保护层厚度
                    reinforcement_data:reinforcement_data,
                    //切体砂浆强度
                    masonry_mortar_strength:masonry_mortar_strength,
                    //植筋锚固力
                    planting_anchor:planting_anchor,
                    status:status,
                    PageName:'js.foundation.FoundationAShowPage',
                    storeAll:'js.store.foundation.RfoundationSystemStore',
                    FoundationShowBg:'js.foundation.FoundationShowGczlccBg',
                };
                newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
                newPanel = Ext.getCmp('js.foundation.foundationPageMain');
                if (newPanel) {
                    newPanel.close();
                }
                if (newPanelA) {
                    newPanelA.close();
                }
                util.sysPanelAdd('js.foundation.foundationAPageMain',params);
            });
            break;
        case 19:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'主体砼结构',
                //总状态
                Zstsatus:concrete_structure,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
        case 20:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'建筑材料/构配件抽查',
                //总状态
                Zstsatus:material_check_c,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
        case 21:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'主体结构',
                //总状态
                Zstsatus:main_structure,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
        case 22:
            params={
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                engineering_name:engineering_name,
                titleName:'装饰装修等工程',
                //总状态
                Zstsatus:other_projects,
                status:status,
                PageName:'js.foundation.FoundationShowPage',
                storeAll:'js.store.foundation.RfoundationSystemStore',
                FoundationShowBg:'js.foundation.FoundationShowBg',
            };
            newPanelA = Ext.getCmp('js.foundation.foundationAPageMain');
            newPanel = Ext.getCmp('js.foundation.foundationPageMain');
            if (newPanel) {
                newPanel.close();
            }
            if (newPanelA) {
                newPanelA.close();
            }
            util.sysPanelAdd('js.foundation.foundationPageMain',params);
            break;
    }
}

delgcjdysjdA=function (record) {
    let information_id =record.information_id;
    let region_name ='';
    let delTip = Ext.create('js.windows.DelTip',{name:region_name});
    let btnSubmit = Ext.create('Ext.button.Button', {
        text: '删除',
        cls:'btnSubmit',
        width:100,
        height:40,
        scale: 'medium',
        margin:'0 20 40 0',
        scale: 'medium',
        handler: function (btn) {
            Ext.create('Ext.window.Window', {
                title: '关键操作密码验证',
                height: '250', width: '500',
                border: false, modal: true, constrainHeader: true, buttonAlign: 'center',
                items: [{
                    padding: '30 30 20 150', html: '<span style="font-size:18px;">请输当前登录用户的密码:</span>', border: false ,
                }, {
                    xtype: 'textfield', id: 'authentication', inputType: 'password', padding: '0 30 0 130', autoComplete: false,width:250,
                }],
                buttons: [{
                    text: '确定',
                    cls: 'groupStaffButtonHistoryyA',
                    scale: 'medium',
                    cls:'btnSubmit',
                    width:100,
                    height:40,
                    margin:'0 20 40 0',
                    handler: function () {
                        let value = Ext.getCmp('authentication').getValue(), window = this.up('window');
                        if (value) {
                            js.Util.post('authentication', {password: value})
                                .then(function (response, opts) {
                                    let obj = Ext.decode(response.responseText);
                                    if (obj.success === true) {
                                        window.close();
                                        util.post('progressRoutes', {
                                            action_type: 'progressDel',
                                            information_id: information_id
                                        }).then(function (response) {
                                            let obj = Ext.decode(response.responseText);
                                            if (obj.success) {
                                                Ext.toast('删除成功');
                                                btn.up('window').close();
                                                Ext.getCmp('FoundationAXYShowPage').store.reload();
                                                Ext.getCmp('FoundationAYShowPage').store.reload();
                                                Ext.getCmp('FoundationAShowPage').store.reload();
                                            } else {
                                                Ext.toast(obj.message);
                                            }
                                        })
                                    }
                                    else {
                                        Ext.toast(obj.message);
                                    }
                                })
                        }
                    }
                }, {
                    text: '取消',
                    scale: 'medium',
                    border:false,
                    cls: 'btnCancel',
                    width: '25%',
                    handler: function () {
                        this.up('window').close();
                    }
                }]
            }).show();
        }
    });
    let btnCancel = Ext.create('Ext.button.Button', {
        border:false,
        text: `<span style="color: #fff;" >取消</span>`,
        cls: 'btnCancel',
        width:100,
        height:40,
        style:{
            color:'#ececec'
        },
        margin: '0 90 45 30',
        scale: 'medium',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this
    });
    let win = util.window(delTip, {title: '删除',border:'#fff',width:'450',height:'250',cls:'windowsBorder', buttons: [ btnSubmit, btnCancel]});
    win.show();
};
updgcjdysjdA=function (record) {
    let information_id = record.information_id;
    let btnCancel = Ext.create('Ext.button.Button', {
        cls: 'btnCancel',
        text: `取消`,
        scale: 'medium',
        width:140,
        height:42,
        margin:'0 0 20 200',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this

    });
    let btnSubmit = Ext.create('Ext.button.Button', {
        cls:'btnSubmit',
        border:false,
        text: `保存`,
        margin: '0 0 20 30',
        width:140,
        height:42,
        scale: 'medium',
        handler: function (btn) {
            let supervision_date=Ext.getCmp('supervision_date').getValue();
        /*    let user_id=Ext.getCmp('user_id_bbr').getValue();*/
            let user_name_bbr=Ext.getCmp('user_name_bbr').getValue();
            let inspection_date=Ext.getCmp('inspection_date').getValue();
            let inspection_no=Ext.getCmp('inspection_no').getValue();
            let inspection_name=Ext.getCmp('inspection_name').getValue();
            let rectification_date=Ext.getCmp('rectification_date').getValue();
            let supervision_details=Ext.getCmp('supervision_details').getValue();
            let user_ids=Ext.getCmp('supervisor_id_jdr').getValue();
            if(user_name_bbr===''||inspection_date===''||inspection_no===''){
                Ext.toast('请将信息填写完整');
            }else if(/^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(inspection_no)==false){
                Ext.toast('手机号码不正确');
            }else {
                util.post('/progressRoutes', {
                    action_type: 'progressUpdate',
                    rectification_date:rectification_date,
                    information_id: information_id,
                    supervision_date: supervision_date,
                /*    user_id: user_id,*/
                    reporter_name:user_name_bbr,
                    inspection_date: inspection_date,
                    inspection_no: inspection_no,
                    inspection_name: inspection_name,
                    supervision_details: supervision_details,
                    user_ids: user_ids,
                    inspection_result: Ext.getCmp('inspection_result').getValue().inspection_result ? Ext.getCmp('inspection_result').getValue() : Ext.getCmp('inspection_result').value,
                    rectification_notice: Ext.getCmp('rectification_notice').getValue(),
                    rectification_reply: Ext.getCmp('rectification_reply').getValue(),
                    remarks: Ext.getCmp('remarks').getValue(),

                }).then(function (response) {
                    let obj = Ext.decode(response.responseText);
                    if (obj.success) {
                        Ext.toast('修改成功');
                        btn.up('window').close();
                        Ext.getCmp('FoundationAXYShowPage').store.reload();
                        Ext.getCmp('FoundationAYShowPage').store.reload();
                        Ext.getCmp('FoundationAShowPage').store.reload();


                    } else {
                        Ext.toast(`<div style="font-size:28px;">保存失败,${obj.message}</div>`);
                    }
                });
            }
        },
        scope: this
    });
    let formPanel = Ext.create('js.foundation.foundationAddPage',record);
    let win = util.window(formPanel, {title:'修改'  ,width:'58%',height:'91.5%',  buttons: ['->', btnCancel, btnSubmit, '->']});
    win.show();
};

delgcjdysjd=function (record) {
    let information_id =record.information_id;
    let region_name ='';
    let delTip = Ext.create('js.windows.DelTip',{name:region_name});
    let btnSubmit = Ext.create('Ext.button.Button', {
        text: '删除',
        cls:'btnSubmit',
        width:100,
        height:40,
        scale: 'medium',
        margin:'0 20 40 0',
        scale: 'medium',
        handler: function (btn) {
            Ext.create('Ext.window.Window', {
                title: '关键操作密码验证',
                height: '250', width: '500',
                border: false, modal: true, constrainHeader: true, buttonAlign: 'center',
                items: [{
                    padding: '30 30 20 150', html: '<span style="font-size:18px;">请输当前登录用户的密码:</span>', border: false ,
                }, {
                    xtype: 'textfield', id: 'authentication', inputType: 'password', padding: '0 30 0 130', autoComplete: false,width:250,
                }],
                buttons: [{
                    text: '确定',
                    cls: 'groupStaffButtonHistoryyA',
                    scale: 'medium',
                    cls:'btnSubmit',
                    width:100,
                    height:40,
                    margin:'0 20 40 0',
                    handler: function () {
                        let value = Ext.getCmp('authentication').getValue(), window = this.up('window');
                        if (value) {
                            js.Util.post('authentication', {password: value})
                                .then(function (response, opts) {
                                    let obj = Ext.decode(response.responseText);
                                    if (obj.success === true) {
                                        window.close();
                                        util.post('progressRoutes', {
                                            action_type: 'progressDel',
                                            information_id: information_id
                                        }).then(function (response) {
                                            let obj = Ext.decode(response.responseText);
                                            if (obj.success) {
                                                Ext.toast('删除成功');
                                                btn.up('window').close();
                                                Ext.getCmp('FoundationABShowPage').store.reload();
                                            } else {
                                                Ext.toast(obj.message);
                                            }
                                        })
                                    }
                                    else {
                                        Ext.toast(obj.message);
                                    }
                                })
                        }
                    }
                }, {
                    text: '取消',
                    scale: 'medium',
                    border:false,
                    cls: 'btnCancel',
                    width: '25%',
                    handler: function () {
                        this.up('window').close();
                    }
                }]
            }).show();
        }
    });
    let btnCancel = Ext.create('Ext.button.Button', {
        border:false,
        text: `<span style="color: #fff;" >取消</span>`,
        cls: 'btnCancel',
        width:100,
        height:40,
        style:{
            color:'#ececec'
        },
        margin: '0 90 45 30',
        scale: 'medium',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this
    });
    let win = util.window(delTip, {title: '删除',border:'#fff',width:'450',height:'250',cls:'windowsBorder', buttons: [ btnSubmit, btnCancel]});
    win.show();
};
Adelgcjdysjd=function (record) {
    let information_id =record.information_id;
    let region_name ='';
    let delTip = Ext.create('js.windows.DelTip',{name:region_name});
    let btnSubmit = Ext.create('Ext.button.Button', {
        text: '删除',
        cls:'btnSubmit',
        width:100,
        height:40,
        scale: 'medium',
        margin:'0 20 40 0',
        scale: 'medium',
        handler: function (btn) {
            Ext.create('Ext.window.Window', {
                title: '关键操作密码验证',
                height: '250', width: '500',
                border: false, modal: true, constrainHeader: true, buttonAlign: 'center',
                items: [{
                    padding: '30 30 20 150', html: '<span style="font-size:18px;">请输当前登录用户的密码:</span>', border: false ,
                }, {
                    xtype: 'textfield', id: 'authentication', inputType: 'password', padding: '0 30 0 130', autoComplete: false,width:250,
                }],
                buttons: [{
                    text: '确定',
                    cls: 'groupStaffButtonHistoryyA',
                    scale: 'medium',
                    cls:'btnSubmit',
                    width:100,
                    height:40,
                    margin:'0 20 40 0',
                    handler: function () {
                        let value = Ext.getCmp('authentication').getValue(), window = this.up('window');
                        if (value) {
                            js.Util.post('authentication', {password: value})
                                .then(function (response, opts) {
                                    let obj = Ext.decode(response.responseText);
                                    if (obj.success === true) {
                                        window.close();
                                        util.post('progressRoutes', {
                                            action_type: 'progressDel',
                                            information_id: information_id
                                        }).then(function (response) {
                                            let obj = Ext.decode(response.responseText);
                                            if (obj.success) {
                                                Ext.toast('删除成功');
                                                btn.up('window').close();
                                                Ext.getCmp('FoundationShowPage').store.reload();
                                            } else {
                                                Ext.toast(obj.message);
                                            }
                                        })
                                    }
                                    else {
                                        Ext.toast(obj.message);
                                    }
                                })
                        }
                    }
                }, {
                    text: '取消',
                    scale: 'medium',
                    border:false,
                    cls: 'btnCancel',
                    width: '25%',
                    handler: function () {
                        this.up('window').close();
                    }
                }]
            }).show();
        }
    });
    let btnCancel = Ext.create('Ext.button.Button', {
        border:false,
        text: `<span style="color: #fff;" >取消</span>`,
        cls: 'btnCancel',
        width:100,
        height:40,
        style:{
            color:'#ececec'
        },
        margin: '0 90 45 30',
        scale: 'medium',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this
    });
    let win = util.window(delTip, {title: '删除',border:'#fff',width:'450',height:'250',cls:'windowsBorder', buttons: [ btnSubmit, btnCancel]});
    win.show();
};
updgcjdysjd=function (record) {
    let information_id = record.information_id;
    let btnCancel = Ext.create('Ext.button.Button', {
        cls: 'btnCancel',
        text: `取消`,
        scale: 'medium',
        width:140,
        height:42,
        margin:'0 0 20 200',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this

    });
    let btnSubmit = Ext.create('Ext.button.Button', {
        cls:'btnSubmit',
        border:false,
        text: `保存`,
        margin: '0 0 20 30',
        width:140,
        height:42,
        scale: 'medium',
        handler: function (btn) {
            let supervision_date=Ext.getCmp('supervision_date').getValue();
           /* let user_id=Ext.getCmp('user_id_bbr').getValue();*/
            let user_name_bbr=Ext.getCmp('user_name_bbr').getValue();
            let inspection_date=Ext.getCmp('inspection_date').getValue();
            let inspection_no=Ext.getCmp('inspection_no').getValue();
            let inspection_name=Ext.getCmp('inspection_name').getValue();
            let rectification_date=Ext.getCmp('rectification_date').getValue();
            let supervision_details=Ext.getCmp('supervision_details').getValue();
            let user_ids=Ext.getCmp('supervisor_id_jdr').getValue();
            if(user_name_bbr===''||inspection_date===''||inspection_no===''){
                Ext.toast('请将信息填写完整');
            }else  if(/^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(inspection_no)==false){
                Ext.toast('手机号码不正确');
            }else {
                util.post('/progressRoutes', {
                    action_type: 'progressUpdate',
                    rectification_date:rectification_date,
                    information_id: information_id,
                    supervision_date: supervision_date,
                    reporter_name:user_name_bbr,
                    inspection_date: inspection_date,
                    inspection_no: inspection_no,
                    inspection_name: inspection_name,
                    supervision_details: supervision_details,
                    user_ids: user_ids,
                    inspection_result: Ext.getCmp('inspection_result').getValue().inspection_result ? Ext.getCmp('inspection_result').getValue() : Ext.getCmp('inspection_result').value,
                    rectification_notice: Ext.getCmp('rectification_notice').getValue(),
                    rectification_reply: Ext.getCmp('rectification_reply').getValue(),
                    remarks: Ext.getCmp('remarks').getValue(),

                }).then(function (response) {
                    let obj = Ext.decode(response.responseText);
                    if (obj.success) {
                        Ext.toast('修改成功');
                        btn.up('window').close();
                        Ext.getCmp('FoundationABShowPage').store.reload();


                    } else {
                        Ext.toast(`<div style="font-size:28px;">保存失败,${obj.message}</div>`);
                    }
                });
            }
        },
        scope: this
    });
    let formPanel = Ext.create('js.foundation.foundationAddPage',record);
    let win = util.window(formPanel, {title:'修改'  ,width:'58%',height:'91.5%',  buttons: ['->', btnCancel, btnSubmit, '->']});
    win.show();
};
Aupdgcjdysjd=function (record) {
    let information_id = record.information_id;
    let btnCancel = Ext.create('Ext.button.Button', {
        cls: 'btnCancel',
        text: `取消`,
        scale: 'medium',
        width:140,
        height:42,
        margin:'0 0 20 200',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this

    });
    let btnSubmit = Ext.create('Ext.button.Button', {
        cls:'btnSubmit',
        border:false,
        text: `保存`,
        margin: '0 0 20 30',
        width:140,
        height:42,
        scale: 'medium',
        handler: function (btn) {
            let supervision_date=Ext.getCmp('supervision_date').getValue();
            let user_name_bbr=Ext.getCmp('user_name_bbr').getValue();
            let inspection_date=Ext.getCmp('inspection_date').getValue();
            let inspection_no=Ext.getCmp('inspection_no').getValue();
            let inspection_name=Ext.getCmp('inspection_name').getValue();
            let rectification_date=Ext.getCmp('rectification_date').getValue();
            let supervision_details=Ext.getCmp('supervision_details').getValue();
            let user_ids=Ext.getCmp('supervisor_id_jdr').getValue();
            if(user_name_bbr===''||inspection_date===''||inspection_no===''){
                Ext.toast('请将信息填写完整');
            }else  if(/^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/.test(inspection_no)==false){
                Ext.toast('手机号码不正确');
            }else {
                util.post('/progressRoutes', {
                    action_type: 'progressUpdate',
                    rectification_date:rectification_date,
                    information_id: information_id,
                    supervision_date: supervision_date,
                    reporter_name:user_name_bbr,
                    inspection_date: inspection_date,
                    inspection_no: inspection_no,
                    inspection_name: inspection_name,
                    supervision_details: supervision_details,
                    user_ids: user_ids,
                    inspection_result: Ext.getCmp('inspection_result').getValue().inspection_result ? Ext.getCmp('inspection_result').getValue() : Ext.getCmp('inspection_result').value,
                    rectification_notice: Ext.getCmp('rectification_notice').getValue(),
                    rectification_reply: Ext.getCmp('rectification_reply').getValue(),
                    remarks: Ext.getCmp('remarks').getValue(),

                }).then(function (response) {
                    let obj = Ext.decode(response.responseText);
                    if (obj.success) {
                        Ext.toast('修改成功');
                        btn.up('window').close();
                        Ext.getCmp('FoundationShowPage').store.reload();


                    } else {
                        Ext.toast(`<div style="font-size:28px;">保存失败,${obj.message}</div>`);
                    }
                });
            }
        },
        scope: this
    });
    let formPanel = Ext.create('js.foundation.foundationAddPage',record);
    let win = util.window(formPanel, {title:'修改'  ,width:'58%',height:'91.5%',  buttons: ['->', btnCancel, btnSubmit, '->']});
    win.show();
};
xiangqinggcjdysjd = function (record) {
    let formPanel = Ext.create('js.foundation.foundationxiangqingshowPage',record);
    let win = util.window(formPanel, {title:'详情' ,width:'40%',height:'65%'});
    win.show();
};
jgcy=function(
    engineering_id
    ,status
    ,engineering_no
    ,engineering_name
    ,completion_initial_inspection
){

    util.post('progressRoutes', {
        action_type: 'progressTestQuery',
        engineering_id:engineering_id,
        progress_type:status
    }).then(function (response) {
        //查询的数据
        let obj = Ext.decode(response.responseText);

        if(obj.success){
            let party_a_material = obj.data.party_a_material;
            let construction_material = obj.data.construction_material;
            let acceptance_data = obj.data.acceptance_data;
            let btnBcSubmit = Ext.create('Ext.button.Button', {
                cls: 'btnSubmit',
                border: false,
                text: `保存`,
                margin: '0 0 20 30',
                width: 140,
                height: 35,
                scale: 'medium',
                handler: function (btn) {
                    util.post('/progressRoutes', {
                        action_type: 'progressTestUpdate',
                        engineering_id: engineering_id,
                        type: completion_initial_inspection,
                        party_a_material: Ext.getCmp('party_a_material').getValue(),
                        construction_material: Ext.getCmp('construction_material').getValue(),
                        acceptance_data: Ext.getCmp('acceptance_data').getValue(),
                    }).then(function (response) {
                        let obj = Ext.decode(response.responseText);
                        if (obj.success) {
                            Ext.toast('完成');
                            btn.up('window').close();
                            let newPanel = Ext.getCmp('js.information.InformationListMain');
                            if (newPanel) {
                                newPanel.close();
                            }
                            util.sysPanelAdd('js.information.InformationListMain', {
                                engineering_id: engineering_id,
                                engineering_no: engineering_no,
                                num: 1,
                                engineering_name: engineering_name
                            });

                        } else {
                            Ext.toast(`<div style="font-size:28px;">失败,${obj.message}</div>`);
                        }
                    });
                },
                scope: this
            });
            let btnSubmit = Ext.create('Ext.button.Button', {
                cls: 'btnSubmit',
                border: false,
                text: `完成`,
                margin: '0 0 20 30',
                width: 140,
                height: 35,
                scale: 'medium',
                handler: function (btn) {
                    util.post('/progressRoutes', {
                        action_type: 'progressTestUpdate',
                        engineering_id: engineering_id,
                        type: completion_initial_inspection,
                        party_a_material: Ext.getCmp('party_a_material').getValue(),
                        construction_material: Ext.getCmp('construction_material').getValue(),
                        acceptance_data: Ext.getCmp('acceptance_data').getValue(),
                    }).then(function (response) {
                        let obj = Ext.decode(response.responseText);
                        if (obj.success) {
                            Ext.toast('完成');
                            btn.up('window').close();
                            let newPanel = Ext.getCmp('js.information.InformationListMain');
                            if (newPanel) {
                                newPanel.close();
                            }
                            util.sysPanelAdd('js.information.InformationListMain', {
                                engineering_id: engineering_id,
                                engineering_no: engineering_no,
                                num: 1,
                                engineering_name: engineering_name
                            });

                        } else {
                            Ext.toast(`<div style="font-size:28px;">失败,${obj.message}</div>`);
                        }
                    });
                },
                scope: this
            });
            let formPanel = Ext.create('js.foundation.foundationJgcyPage', {
                party_a_material: party_a_material,
                construction_material: construction_material,
                acceptance_data: acceptance_data
            });
            let win = util.window(formPanel, {
                title: '竣工初验',
                width: '550',
                height: '38%',
                buttons: ['->',btnBcSubmit, btnSubmit, '->']
            });
            win.show();

        }else {
            Ext.toast(obj.message);

        }

    });
};
jgys=function(engineering_id,status,engineering_no,engineering_name,completion_acceptance){
    util.post('progressRoutes', {
        action_type: 'progressTestQuery',
        engineering_id:engineering_id,
        progress_type:status
    }).then(function (response) {
        //查询的数据
        let obj= Ext.decode(response.responseText);
        if(obj.success){
            let remarks = obj.data.remarks;
            let completion_date = obj.data.completion_date;
            let user_id = obj.data.user_id;
            let user_name = obj.data.user_name;
            let user_ids = obj.data.user_ids;
            let user_names = obj.data.user_names;

            //通过时间
            let review_pass_date=obj.data.review_pass_date;
            //报送时间
            let inspection_date=obj.data.inspection_date;
            let btnSubmit = Ext.create('Ext.button.Button', {
                cls: 'btnSubmit',
                border: false,
                text: `完成`,
                margin: '0 0 10 30',
                width: 140,
                height: 35,
                scale: 'medium',
                handler: function (btn) {
                    util.post('/progressRoutes', {
                        action_type: 'progressCompletionFinish',
                        progress_type: status,
                        engineering_id: engineering_id,
                        remarks: Ext.getCmp('remarks').getValue(),
                        completion_date: Ext.getCmp('completion_date').getValue(),
                        review_pass_date: Ext.getCmp('review_pass_date').getValue(),
                        inspection_date: Ext.getCmp('inspection_date').getValue(),
                        user_id: Ext.getCmp('user_id_bbrA').getValue(),
                        user_ids: Ext.getCmp('user_ids_jdrA').getValue(),
                    }).then(function (response) {
                        let obj = Ext.decode(response.responseText);
                        if (obj.success) {
                            Ext.toast('成功');
                            btn.up('window').close();
                            let newPanel = Ext.getCmp('js.information.InformationListMain');
                            if (newPanel) {
                                newPanel.close();
                            }
                            util.sysPanelAdd('js.information.InformationListMain', {
                                engineering_id: engineering_id,
                                engineering_no: engineering_no,
                                num: 1,
                                engineering_name: engineering_name,

                        });
                        } else {
                            Ext.toast(`<div style="font-size:28px;">失败,${obj.message}</div>`);
                        }
                    });
                },
                scope: this
            });
            let formPanel = Ext.create('js.foundation.foundationJgysPage', {
                remarks: remarks,
                completion_date: completion_date,
                user_id: user_id,
                user_name: user_name,
                user_ids: user_ids,
                user_names: user_names,
                //通过时间
                review_pass_date:review_pass_date,
                //报送时间
                inspection_date:inspection_date
            });
            let win = util.window(formPanel, {
                title: '竣工验收',
                width: '600',
                height: '60%',
                buttons: ['->', btnSubmit, '->']
            });
            win.show();
        }else {
            Ext.toast(obj.message);
        }
    });
};

xiangqinggcjdysjdupd=function(record){
    let information_id = record.information_id;
    let btnCancel = Ext.create('Ext.button.Button', {
        cls: 'btnCancel',
        text: `取消`,
        scale: 'medium',
        width:140,
        height:42,
        margin:'0 0 20 200',
        handler: function (btn) {
            btn.up('window').close();
        },
        scope: this

    });
    let btnSubmit = Ext.create('Ext.button.Button', {
        cls:'btnSubmit',
        border:false,
        text: `保存`,
        margin: '0 0 20 30',
        width:140,
        height:42,
        scale: 'medium',
        handler: function (btn) {
                util.post('/supervisonRoutes', {
                    action_type: 'supervisionUpdate',
                    information_id:information_id,
                    supervision_date: Ext.getCmp('supervision_date').getValue(),
                    supervisor_id_jdr: Ext.getCmp('supervisor_id_jdr').getValue(),
                    rectification_date: Ext.getCmp('rectification_date').getValue(),
                    supervision_details: Ext.getCmp('supervision_details').getValue(),
                    inspection_result: Ext.getCmp('inspection_result').getValue().inspection_result ? Ext.getCmp('inspection_result').getValue() : Ext.getCmp('inspection_result').value,
                    rectification_notice: Ext.getCmp('rectification_notice').getValue(),
                    rectification_reply: Ext.getCmp('rectification_reply').getValue(),
                    remarks: Ext.getCmp('remarks').getValue(),

                }).then(function (response) {
                    let obj = Ext.decode(response.responseText);
                    if (obj.success) {
                        Ext.toast('修改成功');
                        btn.up('window').close();
                        Ext.getCmp('scheduleShowPage').store.reload();


                    } else {
                        Ext.toast(`<div style="font-size:28px;">保存失败,${obj.message}</div>`);
                    }
                });
        },
        scope: this
    });
    let formPanel = Ext.create('js.schedule.ScheduleUpdPage',record);
    let win = util.window(formPanel, {title:'修改'  ,width:'58%',height:'73%',  buttons: ['->', btnCancel, btnSubmit, '->']});
    win.show();
};